\frame[containsverbatim]
{
  \frametitle{Test code}
{\scriptsize
\begin{verbatim}
public class TestISYNC {
  Object field;
  Object lock = new Object();

  void set(Object value) {
    synchronized (lock) {
      field = value;
    }
  }
  
  Object get() {
    return field;
  }
}
\end{verbatim}
}
}
